package com.example.demo.jpasql;/*
 *@author wujinhui
 *@create ${date} ${time} 
 *@version 1.0.0
 *@blog
 */

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface UseRepository extends JpaRepository<User, Long> {
//    User findByName(String name);
//
//    User findByNameAndAge(String name, Integer age);
//
//    @Query("from User u where u.name=:name")
//    User findUser(@Param("name") String name);
    public List<User> findAllByAge(Integer age);
    public List<User> findAllByName(String name);
}
